<%@ page import="com.wanshi.utils.Constants" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<html  style="background:linear-gradient(to bottom,#fff, #ddd,#fff)">
<head>
    <title>Title</title>

    <style>
        *{
            margin: 0px;
            padding: 0px;
        }
        p{
            font-family: "楷体";
            font-size: 16px;
            line-height: 40px;
            font-weight: bold;
            list-style: none;
            overflow: hidden;
            white-space: nowrap; /*设置不换行*/
            text-overflow: ellipsis;
        }
        p img{vertical-align: middle}

        h1,h3{
            display: inline-block;
        }
        .page a{
            width: 50px;
            height: 40px;
            margin: 0px 5px;

            display: inline-block;
            line-height: 40px;
            text-align: center;
            background-color: orangered;
            border-radius: 10px;
            color: white;
            text-decoration: none;
        }

        .page a:hover{
            background-color: aquamarine;
        }
    </style>
</head>
<body style="padding: 20px">

<%
    int num = Constants.PAGE_SIZE;
    pageContext.setAttribute("num",num);
%>

<h2>班级答题记录</h2>
<hr/>
    <c:forEach items="${page.list}" var="r" varStatus="stat">
        <p>${ (page.curpage-1)*num + stat.index+1}.
            <c:if test="${r.result == 1}">  <img src="${pageContext.request.contextPath}/img/true.jpg"></c:if>
            <c:if test="${r.result == 0}">  <img src="${pageContext.request.contextPath}/img/false.jpg"></c:if>
            <span style="color: blue"><fmt:formatDate value='${r.add_time}' pattern='MM-dd HH:mm'/></span>
               ${r.username}
                <%--${fn:replace(r.timu_content,"<BR>"," ")}--%>
                ${r.timu_content}
        </p>
    </c:forEach>


<p class="page"  style="text-align: center;margin-top: 15px;">共${page.count}条记录 共${page.last}页
    <a href="${pageContext.request.contextPath}/dati/findRecordByClsName?pagenum=${page.first}">首页</a>
    <a href="${pageContext.request.contextPath}/dati/findRecordByClsName?pagenum=${page.shang}">上一页</a>


    <c:forEach begin="${page.startAndEnd[0]}" end="${page.startAndEnd[1]}" step="1" var="shu">
        <c:if test="${page.curpage == shu}">
            ${shu}
        </c:if>
        <c:if test="${page.curpage != shu}">
            <a href="${pageContext.request.contextPath}/dati/findRecordByClsName?pagenum=${shu}">${shu}</a>
        </c:if>

    </c:forEach>


    <a href="${pageContext.request.contextPath}/dati/findRecordByClsName?pagenum=${page.next}">下一页</a>
    <a href="${pageContext.request.contextPath}/dati/findRecordByClsName?pagenum=${page.last}">尾页</a>
</p>

</body>
</html>
